/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.buzzwords.factories;

import com.buzzwords.behaviors.DatabaseBehavior;
import com.buzzwords.dataacess.Database;

/**
 *
 * @author potlow
 */
public abstract class DatabaseFactory {

    public Database getDatabase(int type) {
        Database database = createDatabase();
        DatabaseBehavior databaseBehavior = createDatabaseBehavior(type);
        databaseBehavior.createPm();
        database.setDatabaseBehavior(databaseBehavior);
        return database;
    }

    protected abstract DatabaseBehavior createDatabaseBehavior(int type);

    protected abstract Database createDatabase();
}
